<template>
	<scroll-view scroll-y="true">
	<view class="container">
		<view class="top">
			<view class="icon">
				<image src="../../static/icon/merchant_icon.png" mode="widthFix"></image>
			</view>
			<view class="name">
				{{item.lsMerchantName}}
			</view>
			<view class="money-type">
				<text class="money">{{item.transAmount}}</text>
				<text class="type" :class="item.transStatus=='SUCCESS'?'suceess':'fail'">{{item.transStatus=='SUCCESS'?"成功":"失败"}}</text>
			</view>
			<view class="pos-type">
				<image :src="getTypeName(item.payTypeCode,'1')" mode="widthFix"></image>
			<text class="pos-name">{{getTypeName(item.payTypeCode,'2')}}</text>
			</view>
		</view>
		<view class="item">
			<view class="left">
				交易金额
			</view>
			<view class="right">
				{{item.transAmount}}
			</view>
		</view>
		<view class="item">
			<view class="left">
				交易时间
			</view>
			<view class="right">
				{{item.transTime}}
			</view>
		</view>
		<view class="item">
			<view class="left">
				交易类型
			</view>
			<view class="right">
				{{getTypeName(item.payTypeCode,'2')}}
			</view>
		</view>
		<view class="item ">
			<view class="left">
				入账
			</view>
			<view class="right blue">
				{{item.transStatus=='SUCCESS'?"已入账":"未入账"}}
			</view>
		</view>
		<view class="line">
			
		</view>
		<view class="item">
			<view class="left">
				商户名称
			</view>
			<view class="right">
				{{item.lsMerchantName}}
			</view>
		</view>
		<view class="item">
			<view class="left">
				商户编号
			</view>
			<view class="right">
				{{item.merchantNo}}
			</view>
		</view>
		
		<view class="item">
			<view class="left">
				终端编号
			</view>
			<view class="right">
				{{item.sn}}
			</view>
		</view>
		<view class="line">
			
		</view>
	<!-- 	<view class="item">
			<view class="left">
				发卡行号
			</view>
			<view class="right">
				0.0
			</view>
		</view>
		<view class="item">
			<view class="left">
				收单行号
			</view>
			<view class="right">
				0.0
			</view>
		</view> -->
		<view class="item">
			<view class="left">
				卡号
			</view>
			<view class="right">
				{{item.accountNo}}
			</view>
		</view>
		<view class="line">
			
		</view>
		<!-- <view class="item">
			<view class="left">
				批次号
			</view>
			<view class="right">
				0.0
			</view>
		</view>
		<view class="item">
			<view class="left">
				凭证号
			</view>
			<view class="right">
				0.0
			</view>
		</view>
		<view class="item">
			<view class="left">
				授权码
			</view>
			<view class="right">
				0.0
			</view>
		</view>
		<view class="item">
			<view class="left">
				参考号
			</view>
			<view class="right">
				0.0
			</view>
		</view> -->
		
	</view>
	</scroll-view>
</template>

<script setup>
	import {
		onLoad,
		onShow
	} from "@dcloudio/uni-app";
	import {
		ref,
		reactive
	} from "vue";
	import {
		showToast
	} from "@/utils/toast";
	let item = ref({})
	onLoad((option) => {
		console.log("ope=" + JSON.stringify(option))
		item.value = JSON.parse(decodeURIComponent(option.item))
		console.log("item" + JSON.stringify(item.value))
	});

	onShow(() => {});


	function getTypeName(code, type) {
	
		if (code == 'POS') {
			if (type == "1") {
				return "/static/icon/card_icon.png"
			} else {
				return "刷卡支付"
			}
		} else if (code == 'MOBILE_PAY') {
			if (type == "1") {
				return "/static/icon/ysf_icon.png"
			} else {
				return "云闪付"
			}
		} else if (code == 'WX') {
			if (type == "1") {
				return "/static/icon/wx_icon.png"
			} else {
				return "微信支付"
			}
		} else if (code == 'ZFB') {
			if (type == "1") {
				return "/static/icon/alipay_icon.png"
			} else {
				return "支付宝支付"
			}
		} else {
			if (type == "1") {
				return "/static/icon/yl_2_icon.png"
			} else {
				return "刷卡支付"
			}
		}
	}
</script>
<style lang="scss" scoped>
	@import "./index.scss";
</style>
<style lang="scss">
	page {
		background-color: #fff !important;
	}
</style>